$(function (){
    let app = new Vue({
        el: "#app",
        data: {
            formData: {},//表单数据
            sysTitle: "固定资源管理系统",
            userID: "10011001111",
            userName: "林耿奎",
            userImageSrc: "images/common/headPhoto.png",
            backImageSrc: "images/common/back.jpg",
            rules: {//校验规则
                password: [{ required: true, message: '用户密码为必填项', trigger: 'blur' }],
            },
            subList1: [
                {href:"properties.html", li: " 资源管理"},
                {href:"departments.html", li: " 部门管理"},
                {href:"employees.html", li: " 员工管理"}
            ],
            subList2: [
                {href:"infos.html", li: " 个人信息"},
                {href:"passwords.html", li: " 密码修改"},
                {href:"util/login.html", li: " 注销"}
            ]
        },
        created(){
            this.getIDAndName();
        },
        methods: {
            getIDAndName(){
                if(sessionStorage.getItem("userID") === null)
                {
                    location.href = "util/login.html";
                }else {
                    this.userID = sessionStorage.getItem("userID").toString();
                    this.userName = sessionStorage.getItem("userName").toString();
                    this.userImageSrc = "../" + sessionStorage.getItem("userImageSrc").toString()
                }
            }

        }
    });

    /* lis.addClass("current");*/
    var left_nav = $(".left-nav");
    var left_lis = left_nav.children("li");
    var left_sub_nav = left_lis[1].children[1];
    $(left_sub_nav).children("li").eq(1).children("a").addClass("current");

});